package com.lagou.lagoustreamconsumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Input;
import org.springframework.context.annotation.Bean;

import java.util.function.Consumer;

@SpringBootApplication
public class LagouStreamConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(LagouStreamConsumerApplication.class, args);
    }

    /**
     * 函数时编程编写消费者
     * @return
     */
    @Bean
    public Consumer<String> log(){
        return (s)->{
            System.out.println(s+"接受消息");
        };
    }

}
